<template>
	<view class="page_view">
		<view class="zhanwei"></view>
		<view class="list_item flex" v-for="(item, index) in list" :key="index">
			<view class="list_item_img_view">
				<image :src="ImgUrl + item.avatar" mode="" class="list_item_img_view_img"></image>
				<view class="list_item_img_view_zaixian flex1">
					<view class="list_item_img_view_zaixian_dian"></view>
					<view class="list_item_img_view_zaixian_text">
						{{item.is_online == 1?'在线':item.is_online == 0?'离线':'隐身'}}
					</view>
				</view>
			</view>
			<view class="list_item_right">
				<view class="list_item_right_top flex">
					<view class="list_item_right_top_left">
						{{item.name}}
					</view>
					<image src="https://bucketoss10086.oss-cn-beijing.aliyuncs.com/images/zhuanzhu.png" class="list_item_right_top_right" mode=""></image>
				</view>
				<view class="list_item_top_right_bottom flex1">
					<view class="list_item_top_right_bottom_item">
						{{item.level.name}}
					</view>
					<view class="list_item_top_right_bottom_tiao"></view>
					<view class="list_item_top_right_bottom_item">
						{{item.department.name||''}}
					</view>
					<view class="list_item_top_right_bottom_tiao"></view>
					<view class="list_item_top_right_bottom_item">
						{{item.hospital.name}}
					</view>
					<view class="jibie">
						{{item.hospital.level.name}}
					</view>
				</view>
				<view class="list_item_bottom flex">
					<view class="list_item_bottom_left">
						<u-rate size="14" :readonly="true" :count="count" v-model="item.star" activeColor="#0165FB"></u-rate>
						<view class="list_item_bottom_left_bottom">
							月回答：{{item.month_count}}
						</view>
					</view>
					<view class="item_btn" @click="go_detail(item.id)">
						查看详情
					</view>
				</view>
			</view>
		</view>
		<view class="" v-if="list.length == 0">
			<u-empty text="关注列表为空" mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
	import { follow } from '../../api/common.js';
	export default {
		data() {
			return {
				count:5,
				value:4,
				list:[]
			}
		},
		mounted() {
			
		},
		onShow() {
			this.getList();
		},
		computed:{
			ImgUrl(){
				console.log(this.$store.state.ImgUrl)
				return this.$store.state.ImgUrl
			},
		},
		methods: {
			getList(){
				follow().then(res=>{
					if(res.code == 200001){
						this.list = res.data.data;
					}
				})
			},
			go_detail(id){
				uni.navigateTo({
					url:'/pages/DoctorDetails/DoctorDetails?id=' + id
				})
			}
		}
	}
</script>

<style>
page{
	background: #F4F4F4;
}
.zhanwei{
	width: 100%;
	height: 20rpx;
}
.page_view{
	padding: 0 30rpx;
	box-sizing: border-box;
}
.list_item{
	padding: 20rpx;
	box-sizing: border-box;
	background: #fff;
}
.list_item_img_view{
	width: 146rpx;
	height: 174rpx;
	border-radius: 12rpx;
	background: #D9D9D9;
	position: relative;
}
.list_item_img_view_img{
	width: 146rpx;
	height: 174rpx;
	border-radius: 12rpx;
}
.list_item_img_view_zaixian{
	width: 80rpx;
	height: 40rpx;
	border-radius: 12rpx 0rpx;
	background: rgba(0, 0, 0, 0.40);
	position: absolute;
	bottom: 0;
	right: 0;
	justify-content: center;
}
.list_item_img_view_zaixian_dian{
	width: 14rpx;
	height: 14rpx;
	background: #31EC87;
	border-radius: 50%;
}
.list_item_img_view_zaixian_text{
	color: #FFF;
	font-family: Alibaba PuHuiTi;
	font-size: 20rpx;
	font-weight: 400;
	margin-left: 4rpx;
}
.list_item_right{
	width: calc(100% - 166rpx);
}
.list_item_right_top_left{
	color: #222;
	font-family: Alibaba PuHuiTi 2.0;
	font-size: 32rpx;
	font-weight: 700;
}
.list_item_right_top_right{
	width: 40rpx;
	height: 40rpx;
}
.list_item_top_right_bottom{
		margin-top: 8rpx;
	}
	.list_item_top_right_bottom_tiao{
		width: 1rpx;
		height: 22rpx;
		background: #DFDFDF;
		margin: 0 12rpx;
	}
	.list_item_top_right_bottom_item{
		color: #444;
		font-family: Alibaba PuHuiTi 2.0;
		font-size: 26rpx;
		font-weight: 400;
	}
	.jibie{
		display: inline-block;
		padding: 4rpx 12rpx;
		border-radius: 8rpx;
		background: linear-gradient(270deg, #FFF4EC 0%, #FFF3D9 98.44%);
		color: #E7980F;
		font-family: Alibaba PuHuiTi 2.0;
		font-size: 20rpx;
		font-weight: 400;
		margin-left: 12rpx;
	}
	.list_item_bottom{
		margin-top: 14rpx;
	}
	.list_item_bottom_left_bottom{
		color: #999;
		font-family: Alibaba PuHuiTi 2.0;
		font-size: 22rpx;
		font-weight: 400;
		margin-top: 14rpx;
	}
	.item_btn{
		width: 128rpx;
		height: 52rpx;
		color: #FFF;
		font-family: Alibaba PuHuiTi 2.0;
		font-size: 20rpx;
		font-weight: 400;
		border-radius: 32rpx;
		text-align: center;
		line-height: 52rpx;
		background: linear-gradient(270deg, #0165FB 0%, #7AA7EB 100%);
	}
</style>
